<template>
  <footer class="footer">
    <span class="todo-count">总计：<strong>{{list.length}}</strong></span>
    <ul @click="changeAll" class="filters">
      <li>
        <a :class="{'selected':isALL==='all'}" href="javascript:;" @click="isALL = 'all'">全部</a>
      </li>
      <li>
        <a :class="{'selected':isALL==='on'}" href="javascript:;" @click="isALL = 'on'">未完成</a>
      </li>
      <li>
        <a :class="{'selected':isALL==='yes'}" href="javascript:;" @click="isALL = 'yes'">已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="delALL">清除已完成</button>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      isALL:'all'
    }
  },
  props:['list'],
  methods:{
    changeAll(){
      this.$emit('changeAdd', this.isALL);
    },
    delALL(){
      this.$emit('delAdd');
    }
  }
} 
</script>